package org.xy.yq.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.xy.yq.dao.IProvince;
import org.xy.yq.entity.Province;
import org.xy.yq.service.IProvinceService;

import java.util.List;

@Service("provinceServiceImpl")
public class ProvinceServiceImpl implements IProvinceService {
    @Autowired
    @Qualifier("provinceImpl")
    private IProvince provinceDao;
    @Override
    public boolean insertProvince(Province province) {
        boolean flag = true;
        try{
            provinceDao.insertProvince(province);
        }catch (Exception e){
            flag =false;
        }
        return flag;
    }

    @Override
    public List<Province> selectAll() {
        return provinceDao.selectAll();
    }

    @Override
    public List<Province> top5() {
        return provinceDao.top5();
    }
}
